#include <assert.h>
#include <vector>
#include <cstdlib>

using namespace std;

void runVectorTest()
{
	// --------------------

    vector<int> numbers;

    assert(0 == numbers.size());

	// --------------------

    numbers.push_back(1);
    numbers.push_back(2);
    numbers.push_back(3);

    assert(3 == numbers.size());
    assert(3 == numbers.back());
    assert(3 == numbers[2]);

	// --------------------

    numbers.pop_back();

    assert(2 == numbers.size());
    assert(2 == numbers.back());
    assert(2 == numbers[1]);

	// --------------------

    numbers.clear();

    assert(0 == numbers.size());

	// --------------------

	vector<int> myvector;

	myvector.push_back(10);

	while (myvector.back() != 0)
	{
	    myvector.push_back(myvector.back() - 1);
	}

	for (unsigned i = 0; i < myvector.size() ; ++i)
	{
	    assert(10 - i == myvector[i]);
	}

	// --------------------

	log("Tests passed");
}
